
#include "xpt2046.h"
#include "delay.h"
#include "lcd1602.h"


void main() 
{
	unsigned int adc_value;
	char str[4] = {'0','0','0','0'}; 
	
	LCD_Init();
	while(1) 
	{
		adc_value = read_xpt2046();
		str[3] = (adc_value % 10) + 0x30;
		str[2] = ((adc_value % 100) / 10) + 0x30;
		str[1] = ((adc_value % 1000) / 100) + 0x30;
		str[0] = (adc_value / 1000) + 0x30;
		LCD_Display(&str, 1, 0, 4);
		delay(99999);
	}
}